package file;

import java.io.File;

/**
 * @Classname: DeleteDirDemo
 * @Author: bromide
 * @CreateTime: 2022/3/25--14:43
 * @Version: V1.0
 * @Desciption: 删除目录
 */
public class DeleteDirDemo {
    public static void main(String[] args) {
        //将当前目录下的demo目录删除
        File dir = new File("./demo");
        if (dir.exists()) {
            //删除目录时只有空目录可以删除
            dir.delete();
            System.out.println("该目录已删除！");
        } else {
            System.out.println("该目录不存在！");
        }
    }
}
